#include<iostream>
#include<unordered_map>
#include<string>
#include<fstream>

using namespace std;

const string pahtname = "./dict.txt";
string sep = ":";

static bool Split(string& line,string* part1,string* part2)
{
    auto it = line.find(sep);
    if(it == string::npos)
    {
        return false;
    }
    *part1 = line.substr(0,it);
    *part2 = line.substr(it+1);
    return true;
}

class Init
{
public:
    Init()
    {
        ifstream in(pahtname);
        if(!in.is_open())
        {
            cerr << "open file failed" << endl;
            exit(1);
        }
        string line;
        while(getline(in,line))
        {
            string part1,part2;
            Split(line,&part1,&part2);
            _dict.insert(make_pair(part1,part2));
        }
    }

    string Translation(const string& key)
    {
        auto it = _dict.find(key);
        if(it == _dict.end()) return "unknwon";
        return it->second;
    }
private:
    unordered_map<string,string> _dict;
};